﻿using System;
using System.Collections.Generic;
using Microsoft.Popfly.GameCreator.Collections;

namespace Microsoft.Popfly.GameCreator.Data
{
    public class ActorInfo
    {
    
        public class StateInfo
        {
            public class EdgeInfo
            {
                public enum EdgeType
                {
                    rect, // defaults to this
                    circle
                }
                [GameXamlProperty]
                public EdgeType Type;
                [GameXamlProperty]
                public double Right;
                [GameXamlProperty]
                public double Left;
                [GameXamlProperty]
                public double Top;
                [GameXamlProperty]
                public double Bottom;
            }
            [GameXamlProperty]
            public String Appearance;
            [GameXamlProperty]
            public Double Width;
            [GameXamlProperty]
            public Double Height;
            [GameXamlProperty]
            public Boolean IsSolid;
            [GameXamlProperty(xamlMappingType = GameXamlProperty.XamlType.complex)]
            public EdgeInfo Edges = new EdgeInfo();
        }
        [GameXamlProperty]
        public String Name;
        [GameXamlProperty]
        public String Description;
        [GameXamlProperty]
        public String Keywords;

        [GameXamlProperty(objectType = typeof(MotionBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "motion")]
        [GameXamlProperty(objectType = typeof(StateChangeBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "stateChange")]
        [GameXamlProperty(objectType = typeof(PropertyChangeBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "PropertyChangeBehavior")]
        [GameXamlProperty(objectType = typeof(CustomBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "CustomBehavior")]
        [GameXamlProperty(objectType = typeof(SceneChangeBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "sceneChange")]
        [GameXamlProperty(objectType = typeof(BulletBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "bullet")]
        [GameXamlProperty(objectType = typeof(SoundBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "sound")]
        [GameXamlProperty(objectType = typeof(AppearBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "appear")]
        [GameXamlProperty(objectType = typeof(DisappearBehaviorInfo), nodeName = "Actor.Behaviors", dictionaryEntryNodeName = "Behavior", attributeName = "Type", attributeValue = "disappear")]
        public OrderedBehaviorStringtionary behaviors;

        [GameXamlProperty(objectType = typeof(StateInfo), nodeName = "Actor.States", dictionaryEntryNodeName = "State")]
        public OrderedDictionary<String, StateInfo> States;
        [GameXamlProperty(objectType = typeof(PropertyInfo), nodeName = "Actor.Properties", dictionaryEntryNodeName = "Property")]
        public Dictionary<String, PropertyInfo> properties;
    }
}
